#include <stdio.h>
#include "my_log.h"


void GetUpdataInfo(void)
{
	UpdataInfo_t CoorBinInfo;
	FILE *file = NULL;
	MY_U32 data_len = 0;
	MY_U8 i = 0;
	
	file = fopen(BIN_FILE_DIR, "r");
	if(NULL != file)
	{
		printf("--------> open sucess!\n");
	}
	else
	{
		return;
	}
	fseek(file, 0, SEEK_SET); 
	data_len = fread(&CoorBinInfo, 1, sizeof(UpdataInfo_t), file);
	if(data_len == sizeof(UpdataInfo_t))
	{
		printf("--------> version = ");
		for(i=0; i<8; i++)
			printf("0x%0x ", CoorBinInfo.version[i]);
		printf("\r\n");

		printf("--------> bin_size = 0x%0x\n", CoorBinInfo.bin_size);
	}
	
	fclose(file);
}


//保存日志内容
void LogsSave(void)
{
    FILE *fp = NULL;
   
    fp = fopen("devices.txt", "a");
	if(NULL != fp)
	{
		printf("写入成功！\n");
		fprintf(fp, "\r\nffffffff\r\n");
	}
    
    fclose(fp);
}


